package 测试;

import java.util.ArrayList;

public class 文本嗅探 {

	public static void main(String[] args) {
		String a = "abcdefg";
		String b = "cdex";
		System.out.println(a.indexOf(b));
	}

}

class KeywordDetect {
	public int[] containKeyword(String[] A, int n, String[] keys, int m) {
		ArrayList<Integer> al = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if ((A[i].indexOf(keys[j])) > -1) {
					al.add(i);
					break;
				}
			}
		}
		if (al.size() == 0) {
			return new int[] { -1 };
		}
		int[] r = new int[al.size()];
		for (int i = 0; i < al.size(); i++) {
			r[i] = al.get(i);
		}
		return r;
	}
}
